﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Shapes;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;

namespace GunApp
{
    public class Bullet
    {
        Texture2D texture;
        Vector2 position;
        Vector2 speed;

        public bool MustRemove
        {
            get { return mustRemove; }
        }
        bool mustRemove;

        public Bullet(Texture2D texture)
        {
            this.texture = texture;
            position = new Vector2(535, 225);
            speed = new Vector2(15, 0);
            mustRemove = false;
        }

        public void Update()
        {
            position.X += speed.X;
            speed += new Vector2(3, 0);

            if (position.X >= 900)
                mustRemove = true;
        }

        public void Draw(SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(texture, position, Color.White);
        } 
    }
}
